# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kmime
pkgver=23.08.4
pkgrel=0
pkgdesc="Library for handling mail messages and newsgroup articles"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later"
depends_dev="
	kcodecs5-dev
	ki18n5-dev
	qt5-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
_repo_url="https://invent.kde.org/pim/kmime.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kmime-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build

	# kmime-headertest and kmime-messagetest are broken
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "kmime-(header|message)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
cbc4952f7b387cf743949f04263f37fea28947b677fd6a6eaa96a575a233b637203cf7c8116a2476e20cf94f9bba09471021fcb0cc07688e040d0d383848f7b9  kmime-23.08.4.tar.xz
"
